package com.gzhu.knowledgeAdmin.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gzhu.knowledgeAdmin.dao.THmdTMapper;
import com.gzhu.knowledgeAdmin.entity.THmdT;
import com.gzhu.knowledgeAdmin.service.THmdTService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class THmdTServiceImpl extends ServiceImpl<THmdTMapper, THmdT> implements THmdTService {
    @Resource
    private THmdTMapper tHmdTMapper;


    @Override
    public List<THmdT> getHmd(THmdT tHmdT) {
        return tHmdTMapper.getHmd(tHmdT);
    }

    @Override
    public Integer addBlacklist(THmdT tHmdT) {
        Date now = new Date();
        tHmdT.setFSxsj(now);
        tHmdT.setFLx("0");
        return tHmdTMapper.insertBlacklist(tHmdT);
    }

    @Override
    public Integer updateBlacklist(THmdT tHmdT) {
        return tHmdTMapper.updateBlacklist(tHmdT);
    }

    public List<THmdT> getAllBlacklists() {
        return tHmdTMapper.findAll();
    }
}
